package de.fhdw.hbs.client.utils;

import java.util.Calendar;
import java.util.GregorianCalendar;

import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
/**
 * 
 * @author SZAHEL
 *
 */
public class Mapper {
	public static XMLGregorianCalendar mapCalendar2XML (Calendar cal) throws DatatypeConfigurationException {
		GregorianCalendar von = new GregorianCalendar(cal.YEAR,cal.MONTH, cal.DAY_OF_MONTH);
		XMLGregorianCalendar xml = DatatypeFactory.newInstance().newXMLGregorianCalendar(von);
		return xml;
	}
}
